//
//write by shaochuyu
//
#pragma once 


class CBitmapBtn : public CButton
{
public:
	CBitmapBtn();
	
	~CBitmapBtn();

	void SetBtnText( LPCTSTR lpText );

	void	SetFont(CFont* pFont);

	HRESULT OnSetCursor( WPARAM wParam, LPARAM lParam);
	
	void SetBmp( UINT nNormal, UINT nDown, UINT nOver );

	BOOL SetBtnCursor(LPCTSTR szCursorId);

	LRESULT OnMouseLeave(WPARAM /*wParam*/, LPARAM /*lParam*/);	
	 void OnMouseMove(UINT nFlags, CPoint point);
protected:

	BOOL	LoadBmp(UINT strBmp, CBitmap& bmp);
	
	DECLARE_MESSAGE_MAP()
private:
	HCURSOR m_hCursor;
	CString m_strText;
	bool			m_bMouseOver:1;
	bool			m_bFocus:1;
	bool			m_bPressed:1;
	int				m_nBmpWidth;
	int            m_nBmpHeight;
	CBitmap	m_hBmpNormal;
	CBitmap	m_hBmpHover;
	CBitmap	m_hBmpDown;
	CFont*		m_pFont;
public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};


